package framework.temporal;

import framework.FRDJPanel;
import framework.FRDModel;
import java.io.Serializable;

/**
 *
 * @author Lukáš Marek
 */
public class FRDTemporal extends FRDJPanel implements Serializable
{
	protected FRDTemporalModel model = null;

	/**
	 * Vytvori novy panel FRDTemporal
	 */
	public FRDTemporal()
	{
		initComponents();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents()
  {

    jScrollPaneTable = new javax.swing.JScrollPane(jTable);
    jTable = new javax.swing.JTable();
    jLayeredPane1 = new javax.swing.JLayeredPane();
    jLabel1 = new javax.swing.JLabel();
    filterName = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    filterFrom = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    filterTo = new javax.swing.JTextField();
    filterButton = new javax.swing.JButton();
    jLayeredPane2 = new javax.swing.JLayeredPane();
    deleteButton = new javax.swing.JButton();

    jScrollPaneTable.setViewportView(jTable);
    jTable.setFillsViewportHeight(true);

    jLayeredPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel1.setText("Jméno:");
    jLabel1.setBounds(80, 10, 50, 20);
    jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
    filterName.setBounds(130, 10, 150, 20);
    jLayeredPane1.add(filterName, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    jLabel2.setText("Filtr");
    jLabel2.setBounds(10, 10, 70, 20);
    jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jLabel3.setText("Platnost od:");
    jLabel3.setBounds(290, 10, 70, 20);
    jLayeredPane1.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);
    filterFrom.setBounds(360, 10, 110, 20);
    jLayeredPane1.add(filterFrom, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jLabel4.setText("do:");
    jLabel4.setBounds(490, 10, 20, 20);
    jLayeredPane1.add(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);
    filterTo.setBounds(510, 10, 110, 20);
    jLayeredPane1.add(filterTo, javax.swing.JLayeredPane.DEFAULT_LAYER);

    filterButton.setText("Filtruj");
    filterButton.setActionCommand("filterButton");
    filterButton.setBounds(693, 10, 100, 23);
    jLayeredPane1.add(filterButton, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jLayeredPane2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    deleteButton.setText("Odstranit");
    deleteButton.setActionCommand("deleteButton");
    deleteButton.setBounds(10, 10, 90, 23);
    jLayeredPane2.add(deleteButton, javax.swing.JLayeredPane.DEFAULT_LAYER);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addComponent(jLayeredPane2)
          .addComponent(jScrollPaneTable, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1012, Short.MAX_VALUE)
          .addComponent(jLayeredPane1, javax.swing.GroupLayout.Alignment.LEADING))
        .addContainerGap())
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jScrollPaneTable, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jLayeredPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)
        .addContainerGap())
    );
  }// </editor-fold>//GEN-END:initComponents

  // Variables declaration - do not modify//GEN-BEGIN:variables
  public javax.swing.JButton deleteButton;
  public javax.swing.JButton filterButton;
  public javax.swing.JTextField filterFrom;
  public javax.swing.JTextField filterName;
  public javax.swing.JTextField filterTo;
  public javax.swing.JLabel jLabel1;
  public javax.swing.JLabel jLabel2;
  public javax.swing.JLabel jLabel3;
  public javax.swing.JLabel jLabel4;
  public javax.swing.JLayeredPane jLayeredPane1;
  public javax.swing.JLayeredPane jLayeredPane2;
  private javax.swing.JScrollPane jScrollPaneTable;
  public javax.swing.JTable jTable;
  // End of variables declaration//GEN-END:variables

	/**
	 * Nastaveni modelu
	 * @param model
	 */
	@Override
	public void setModel(FRDModel model)
	{
		this.model = (FRDTemporalModel) model;
	}

	/**
	 * vraci nastaveny model, pro praci nutno pretypovat
	 * @return
	 */
	@Override
	public FRDModel getModel()
	{
		return model;
	}

	public String getFilterName()
	{
		return filterName.getText();
	}

	public String getFilterFrom()
	{
		return filterFrom.getText();
	}

	public String getFilterTo()
	{
		return filterTo.getText();
	}
}
